package cn.cnf.common.enums;

/**
 * @author ZhuMeiYi
 * @date 2021/1/17 21:57
 * @description
 */
public enum MoneyRecordType {

    /**
     * 已添加说明的字段
     */
    ZHUANZHANG("转账",1),
    CHOUCHENG("抽成",2),
    TIXIAN("提现",3),
    CHONGZHI("充值",0);

    /**
     * 类型
     */
    private String type;
    /**
     * 值
     */
    private Integer value;

    MoneyRecordType(String type, Integer value) {
        this.type = type;
        this.value = value;
    }

    public String getType() {
        return type;
    }

    public Integer getValue() {
        return value;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static MoneyRecordType getByValue(Integer value) {
        for (MoneyRecordType moneyRecordType : values()) {
            if (moneyRecordType.getValue().equals(value)) {
                return moneyRecordType;
            }
        }
        return null;
    }
}
